package com.gxuwz.check.model.entity;

import javax.persistence.*;

@Entity
@Table(name = "sys_teacher", schema = "check_db", catalog = "")
public class SysTeacherEntity {
    private int teacherId;
    private String teacherName;
    private Integer teacherSex;
    private String teacherTel;
    private Integer collegeId;
    private Integer classId;
    private Integer courseId;
    private Integer userId;

    @Id
    @Column(name = "teacher_id", nullable = false)
    public int getTeacherId() {
        return teacherId;
    }

    public void setTeacherId(int teacherId) {
        this.teacherId = teacherId;
    }

    @Basic
    @Column(name = "teacher_name", nullable = true, length = 30)
    public String getTeacherName() {
        return teacherName;
    }

    public void setTeacherName(String teacherName) {
        this.teacherName = teacherName;
    }

    @Basic
    @Column(name = "teacher_sex", nullable = true)
    public Integer getTeacherSex() {
        return teacherSex;
    }

    public void setTeacherSex(Integer teacherSex) {
        this.teacherSex = teacherSex;
    }

    @Basic
    @Column(name = "teacher_tel", nullable = true, length = 11)
    public String getTeacherTel() {
        return teacherTel;
    }

    public void setTeacherTel(String teacherTel) {
        this.teacherTel = teacherTel;
    }

    @Basic
    @Column(name = "college_id", nullable = true)
    public Integer getCollegeId() {
        return collegeId;
    }

    public void setCollegeId(Integer collegeId) {
        this.collegeId = collegeId;
    }

    @Basic
    @Column(name = "class_id", nullable = true)
    public Integer getClassId() {
        return classId;
    }

    public void setClassId(Integer classId) {
        this.classId = classId;
    }

    @Basic
    @Column(name = "course_id", nullable = true)
    public Integer getCourseId() {
        return courseId;
    }

    public void setCourseId(Integer courseId) {
        this.courseId = courseId;
    }

    @Basic
    @Column(name = "user_id", nullable = true)
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SysTeacherEntity that = (SysTeacherEntity) o;

        if (teacherId != that.teacherId) return false;
        if (teacherName != null ? !teacherName.equals(that.teacherName) : that.teacherName != null) return false;
        if (teacherSex != null ? !teacherSex.equals(that.teacherSex) : that.teacherSex != null) return false;
        if (teacherTel != null ? !teacherTel.equals(that.teacherTel) : that.teacherTel != null) return false;
        if (collegeId != null ? !collegeId.equals(that.collegeId) : that.collegeId != null) return false;
        if (classId != null ? !classId.equals(that.classId) : that.classId != null) return false;
        if (courseId != null ? !courseId.equals(that.courseId) : that.courseId != null) return false;
        if (userId != null ? !userId.equals(that.userId) : that.userId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = teacherId;
        result = 31 * result + (teacherName != null ? teacherName.hashCode() : 0);
        result = 31 * result + (teacherSex != null ? teacherSex.hashCode() : 0);
        result = 31 * result + (teacherTel != null ? teacherTel.hashCode() : 0);
        result = 31 * result + (collegeId != null ? collegeId.hashCode() : 0);
        result = 31 * result + (classId != null ? classId.hashCode() : 0);
        result = 31 * result + (courseId != null ? courseId.hashCode() : 0);
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "SysTeacherEntity{" +
                "teacherId=" + teacherId +
                ", teacherName='" + teacherName + '\'' +
                ", teacherSex=" + teacherSex +
                ", teacherTel='" + teacherTel + '\'' +
                ", collegeId=" + collegeId +
                ", classId=" + classId +
                ", courseId=" + courseId +
                ", userId=" + userId +
                '}';
    }
}
